const mongoose = require('mongoose')
const Content = require('../../model/content')
const Reply = require('../../model/reply')

module.exports = async (req, res) => {
    const { id } = req.params
    const { content } = req.fields
    try {
        var data = await Content.updateOne({ _id: id }, { content })
        var data = await Reply.updateOne({ _id: id }, { content })
    } catch(err) {
        console.log(err);
        return res.send({
            data: null,
            meta: {
                status: 403,
                msg: '修改失败'
            }
        })
    }
    res.send({
        data: null,
        meta: {
            status: 203,
            msg: '修改成功'
        }
    })
}